package com.warm.pump.module.skd.service.impl;

import com.warm.pump.frame.gen.bean.PageBean;
import com.warm.pump.module.skd.bean.po.gen.ScheduleLog;
import com.warm.pump.module.skd.dao.gen.ScheduleLogDao;
import com.warm.pump.module.skd.service.IScheduleLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;


@Service("ScheduleLogService")
public class ScheduleLogServiceImpl implements IScheduleLogService {
    @Autowired
    private ScheduleLogDao scheduleLogDao;

    @Override
    public ScheduleLog queryObject(Long id) {
        return scheduleLogDao.selectByPrimaryKey(id);
    }

    public ScheduleLog queryObject(Map<String, Object> map) {
        return scheduleLogDao.selectByMap(map);
    }

    @Override
    public List<ScheduleLog> queryList(Map<String, Object> map) {
        return scheduleLogDao.getListByMap(map);
    }

    @Override
    public PageBean getPageBeanByMap(Map map, int pageNo, int pageSize) {
        return scheduleLogDao.getPageBeanByMap(map, pageNo, pageSize);
    }


    @Override
    public int queryTotal(Map<String, Object> map) {
        return scheduleLogDao.countTotalByMap(map);
    }

    @Override
    public void save(ScheduleLog scheduleLog) {
        scheduleLogDao.insertSelective(scheduleLog);
    }

    @Override
    public void update(ScheduleLog scheduleLog) {
        scheduleLogDao.updateByPrimaryKeySelective(scheduleLog);
    }

    @Override
    public void delete(Long id) {
        scheduleLogDao.deleteByPrimaryKey(id);
    }

    @Override
    public void delete(Map<String, Object> map) {
        scheduleLogDao.deleteByMap(map);
    }

    @Override
    public void deleteBatch(Long[] ids) {
        Map<String, Object> map = new HashMap<>();
        map.put("id_in", ids);
        scheduleLogDao.deleteByMap(map);
    }

}
